package com.polytech.diploma.SQLGenerator.Oracle.Arguments;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class Field implements Argument {
	protected String name;
	protected String tableName;
	protected DataType type = null;
	
	public Field(String name) {
		super();
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	@Override
	public Map<String, List<String>> getTablesWithFields(Map<String, List<String>> fieldMap) {
		List<String> fieldList = fieldMap.get(tableName);
		if(fieldList == null)
		{
			fieldList = new ArrayList<String>();			
		}
		
		fieldList.add(name);
		fieldMap.put(tableName, fieldList);
		return fieldMap;
	}


	
	
}
